-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draft support for parsing slot results and appending text #52187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mchugh19 Can you please add a test or two that cover this?
Tests have been added for the traverse and append functions. In thinking about this a little bit more, the parsing for the append function looks for a tilde character and appends everything afterwards. It is possible that the slot text itself could contain that character as you might have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests added
@DmitryKuzmenko you should take a look here as well |
draft support for parsing slot results and appending text
What does this PR do?
Extends slot syntax to support parsing resulting dictionaries and appending text. Note: the appending process only functions on slot results which are strings.
Next steps:
{u'shell': u'/bin/bash'}
we could also force to json output if desired.What issues does this PR fix or reference?
#50462
#46771
Previous Behavior
Using
__slots__
with modules which return dictionaries required custom modules to parse resultAlso, unable to append text
New Behavior
Support dictionary results by appending the slot function with period delimited dictionary keys to traverse
__slot__:salt:user.info(root).shell
returns/bin/bash
Support appending data by using a tilde delimiter followed by text
__slot__:salt:user.info(root).shell ~ /appended~
returns/bin/bash/appended~
Tests written?
Yes
Commits signed with GPG?
No